package com.liam.game.ui.bird;

import com.liam.game.util.Utils;

import java.awt.image.BufferedImage;

/**
 * 地面
 */
public class Ground {

    int x;
    int y;

    BufferedImage img;

    // 地面宽度
    int w;
    // 地面高度
    int h;

    public Ground() {
        img = Utils.getImg("static/img/bird/ground.png");
        h = img.getHeight();
        w = img.getWidth();

        x = 0;
        y = GameFrame.FRAME_HEIGHT - h;
    }

    /**
     * 地面移动
     */
    public void move() {
        if (x <= -(w - GameFrame.FRAME_WIDTH)) {
            x = 0;
        }
        x--;

    }
}
